import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';

@Component({
  selector: 'app-dashboard',
  standalone: true,
  imports: [CommonModule],
  template: `
    <div class="dashboard">
      <div class="welcome-card">
        <h2>欢迎来到管理系统</h2>
        <p>请从左侧菜单选择要进行的操作</p>
      </div>
      <div class="stats-grid">
        <div class="stat-card">
          <i class="fas fa-users"></i>
          <h3>用户总数</h3>
          <p class="stat-number">1,234</p>
        </div>
        <div class="stat-card">
          <i class="fas fa-chart-line"></i>
          <h3>今日访问</h3>
          <p class="stat-number">256</p>
        </div>
        <div class="stat-card">
          <i class="fas fa-tasks"></i>
          <h3>待处理任务</h3>
          <p class="stat-number">15</p>
        </div>
        <div class="stat-card">
          <i class="fas fa-check-circle"></i>
          <h3>已完成任务</h3>
          <p class="stat-number">45</p>
        </div>
      </div>
    </div>
  `,
  styles: [`
    .dashboard {
      padding: 20px;
    }
    
    .welcome-card {
      background: linear-gradient(135deg, #3498db, #2980b9);
      color: white;
      padding: 30px;
      border-radius: 10px;
      margin-bottom: 30px;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .welcome-card h2 {
      margin: 0 0 10px 0;
      font-size: 24px;
    }
    
    .welcome-card p {
      margin: 0;
      opacity: 0.9;
    }
    
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 20px;
    }
    
    .stat-card {
      background: white;
      padding: 20px;
      border-radius: 10px;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
      text-align: center;
      transition: transform 0.3s ease;
    }
    
    .stat-card:hover {
      transform: translateY(-5px);
    }
    
    .stat-card i {
      font-size: 2em;
      color: #3498db;
      margin-bottom: 10px;
    }
    
    .stat-card h3 {
      margin: 10px 0;
      color: #2c3e50;
      font-size: 16px;
    }
    
    .stat-number {
      font-size: 24px;
      font-weight: bold;
      color: #2c3e50;
      margin: 0;
    }
  `]
})
export class DashboardComponent {}